package com.hangsu.train.netty;

import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.group.ChannelGroup;
import io.netty.channel.group.DefaultChannelGroup;
import io.netty.util.concurrent.GlobalEventExecutor;

import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;

public class ClientHolder {

    public static final ConcurrentMap<String, ChannelHandlerContext> users = new ConcurrentHashMap<>();

    private static ChannelGroup socketClients = new DefaultChannelGroup(GlobalEventExecutor.INSTANCE);

    public static ChannelGroup getSocketClient(){
        return socketClients;
    }

}